package code.juc.threadlocal;

/**
 * 可以继承父线程数据的子ThreadLocal
 */
public class InheritableThreadLocalExt extends InheritableThreadLocal {

    @Override
    protected Object initialValue() {
        return Thread.currentThread().getName() + Thread.currentThread().getId();
    }

    @Override
    protected Object childValue(Object parentValue) {
        return parentValue + "子线程添加的数据";
    }
}
